$(function(){
	$("#functionNav").attr("href",navAddr);
	//获取并填充保管部门
	var bgbmJson = ajaxResult("get",false,ProjectName+"/sysmanage.getIdAndNameInjb.do",{'tableName':'jb_bgbm'});
	loadSelect("#bgbmid",bgbmJson.rows,'id','name');	
	//获取查询条件
	var searchParams =$("#form1").serializeObject();	
	//初始化寄存单据Table	
	createTableOrderBy('#dbTable',ProjectName+'/col.getRelicDtxxList.do','id',tblColTitle,searchParams);
	
	//点击查询按钮
	 $("#search_btn").click(function(){
		 refreshTable('#dbTable','#form1');
	 });
})

var tblColTitle = [{
			checkbox:true
		},{
	        field: 'zdjh',
	        title: '总登记号',
	        sortable:true
	    }, {
	        field: 'cpmc',
	        title: '藏品名称',
	        sortable:true
	    },{
	        field: 'dtlx',
	        title: '动态类型',
	        sortable:true,
	        formatter: function(value, row, index) {
	        	if(value==1){
	        		return  "入库";
	        	}else if(value==2){
	        		return "出库"; 
	        	}else if(value==3){
	        		return "退库"; 
	        	}else if(value==4){
	        		return "移库"; 
	        	}else{
	        		return value;
	        	}
		      }	 
	    },  {
	        field: 'djrmc1',
	        title: '点交人',
	        sortable:true,
	        formatter: function(value, row, index) {
	        	if(row.djrmc2!=""){
	        		return  value+","+row.djrmc2;	        	
	        	}else{
	        		return value;
	        	}
		      }	 
	    }, {
	        field: 'tqrmc1',
	        title: '提取人',
	        sortable:true,
	        formatter: function(value, row, index) {
	        	if(row.tqrmc2!=""){
	        		return  value+","+row.tqrmc2;	        	
	        	}else{
	        		return value;
	        	}
		      }
	    },{
	        field: 'shrmc1',
	        title: '送回人',
	        sortable:true,
	        formatter: function(value, row, index) {
	        	if(row.shrmc2!=""){
	        		return  value+","+row.shrmc2;	        	
	        	}else{
	        		return value;
	        	}
		      }      
	    },{
	        field: 'dsrmc1',
	        title: '点收人',
	        sortable:true,
	        formatter: function(value, row, index) {
	        	if(row.dsrmc2!=""){
	        		return  value+","+row.dsrmc2;	        	
	        	}else{
	        		return value;
	        	}
		      }      
	    },{
	        field: 'ckjdrmc',
	        title: '点交监督员',
	        sortable:true,
	        formatter: function(value, row, index) {	        	
	        	if(value!=""){
	        		return value;	        	
	        	}else if(row.tkjdrmc!=""){
	        		return row.tkjdrmc;
	        	}else{
	        		return '';
	        	}
		      }      
	    },{
	        field: 'fssj',
	        title: '发生时间',
	        sortable:true
	    }];